package po;

import javax.validation.constraints.Min;

import org.hibernate.validator.constraints.NotEmpty;
import org.hibernate.validator.constraints.Range;

public class User {

	@Min(value=0, message="{id}")
	private long id;
	
	//这两个注解的意思一样
//	@NotBlank(message="{name}")
	@NotEmpty(message="{name}")
	private String name;
	
	@Range(min=0, max=150, message="{age}")
	private int userAge;
	
	public User(){}
	public User(String name) {
		super();
		this.name = name;
	}
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getUserAge() {
		return userAge;
	}
	public void setUserAge(int userAge) {
		this.userAge = userAge;
	}
	public String toString(){
		
		return "[id:" + id  + ",name:" + name + ",userAge:" + userAge + "]";
	}
}
